package cms.util;

import cms.common.Result;
import com.alibaba.fastjson.JSONObject;

import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.PrintWriter;

/**
 * 功能:
 * Author: yuhui
 * Date: 2021/4/9 22:50
 */
public class respUtil {

    /**
    * 功能描述: 将响应消息输出给客户端
    * @Author: yuhui  2021/4/9 22:52
    */
    public static void respOutPrint(Result rt, HttpServletResponse resp) throws IOException {
        PrintWriter writer = resp.getWriter();
        writer.print(JSONObject.toJSONString(rt));
        writer.flush();
    }
}
